package com.example.shiwuyouproject.ui.pup

import android.content.Context
import android.widget.TextView
import com.example.shiwuyouproject.R
import com.lxj.xpopup.core.CenterPopupView

class LogOutPopupView(context: Context, var onclick: onClickListener,
                      var stTiShi:String="",
                      var stContext:String="",
                      var stMyCenter:String=""):CenterPopupView(context) {

    override fun getImplLayoutId(): Int {
        return R.layout.put_logout
    }
  private var tvTiShi:TextView?=null
    private var tvContext:TextView?=null
    private var tvMyCenter:TextView?=null
    override fun onCreate() {
        super.onCreate()
        tvTiShi=findViewById(R.id.tvTiShi)
        tvContext=findViewById(R.id.tvContext)
        tvMyCenter=findViewById(R.id.tvMyCenter)
        if(stTiShi.isNotEmpty()){
            tvTiShi?.text = stTiShi
        }
        if(stContext.isNotEmpty()){
            tvContext?.text = stContext
        }
        if(stMyCenter.isNotEmpty()){
            tvMyCenter?.text = stMyCenter
        }
        findViewById<TextView>(R.id.tvCancel).setOnClickListener { dismiss() }
        findViewById<TextView>(R.id.tvMyCenter).setOnClickListener {
            onclick.onCenter()
            dismiss()

        }
    }
    interface  onClickListener{
          fun onCenter()
    }
}